package com.action.addrbook;

import com.db.addrbook.*;
import java.util.List;
public class AddrMainAction {
	private int abcase = 2;
	private String abresult;
	private List<CategoryVO> calist;
	private CategoryDAO caDAO;
	
	public void setCaDAO(CategoryDAO caDAO) {
		this.caDAO = caDAO;
	}
	public void setAbcase(int abcase) {
		this.abcase = abcase;
	}
	public String getAbresult() {
		return abresult;
	}
	public List<CategoryVO> getCalist() {
		return calist;
	}
	
	public String execute() {
		String result = "";
		try {
			if (abcase == 1) {
				abresult = "c_list";
			} else if (abcase == 2) {
				abresult = "list";
			}	
			calist = caDAO.getCategoryList();
			//System.out.println(abresult);
			//System.out.println(calist.toString());
			result = "success";
		} catch (Exception e) {
			System.out.println("AddrMainAction.execute():" + e.toString());
			result = "error";
		}
		return result;
	}
}
